//
//  DMainWindowController.swift
//  Drop
//
//  Created by hushaohua on 2019/2/1.
//  Copyright © 2019 init. All rights reserved.
//

import UIKit

class DMainWindowController: NSObject {
    
    var window: UIWindow?
    
    func start() {
        let size = UIScreen.main.bounds.size;
        self.window = UIWindow(frame: CGRect(x:0,y:0,width:size.width - 0,height:size.height));
        
        if DDateManager.sharedManager().startedBefore() {
            let homeViewController = DHomeViewController(0);
            self.window?.rootViewController = homeViewController;
        }else{
            let guideViewController = MainGuideViewController();
            weak var weakSelf = self;
            guideViewController.startClosure = {
                let homeViewController = DHomeViewController(0);
                weakSelf?.window?.rootViewController = homeViewController;
            };
            self.window?.rootViewController = guideViewController;
        }
        self.window?.makeKeyAndVisible();
    }
}
